package com.example.streams;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class StreamReduce {
    public static void main(String[] args) {
        List<BigDecimal> list = new ArrayList<>();
        list.add(new BigDecimal("1.1"));
        list.add(new BigDecimal("2.2"));
        list.add(new BigDecimal("3.3"));
        BigDecimal total = list.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
        System.out.println(total);
    }
}
